//
//  PGCalendarView.h
//  TestCalendar
//
//  Created by Pill Gong on 14-2-17.
//  Copyright (c) 2014年 Pill Gong. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PGEventListView.h"

typedef enum {
    PrevItem,
    CurrentItem,
    NextItem
} ItemStyle;

typedef enum {
    InitStyle,
    SwipeStyle,
    SelectStyle
} ChangeStyle;

typedef enum {
    Calendar,
    Table
} CalendarOrTable;

@class PGCalendarView;
@class PGCalendarItem;
@protocol PGCalendarViewDelegate <NSObject>

@optional
- (void)currentMonthChanged:(PGCalendarView *)calendar;
- (void)middleViewChanged:(CalendarOrTable)calendarOrTable;
- (void)editCalendarItem:(ScheduleInfo *)scheduleInfo;
- (void)delCalendarItem:(ScheduleInfo *)scheduleInfo;
- (void)finishInitCalendarView;

@end


@interface PGCalendarView : UIView <PGEventListViewDelegate>

@property (nonatomic, assign) id<PGCalendarViewDelegate> delegate;

@property (nonatomic, strong) UIView *contentView;
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) PGEventListView *eventList;
@property (nonatomic, strong) NSMutableArray *dataArray;

@property (nonatomic, strong) UIView *prevView;
@property (nonatomic, strong) UIView *currentView;
@property (nonatomic, strong) UIView *nextView;

@property (nonatomic, strong) NSMutableArray *currentItemsArr;
@property (nonatomic, strong) NSMutableArray *prevItemsArr;
@property (nonatomic, strong) NSMutableArray *nextItemsArr;

@property (nonatomic, strong) UIView *topView;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UILabel *chinaCalendar;
@property (nonatomic, strong) UIButton *todayBtn;

@property (nonatomic, strong) NSMutableDictionary *dataDic;

- (NSString *)getCurrentYearAndMonth;
- (NSDate *)getCurrentYeartMonthAndDay;
- (int)getDayNumOfCurrentMonth;
- (PGCalendarItem *)getSelectedItem;
- (void)resetWithToday;
- (void)resetWithDate:(NSDate *)date;

- (void)dataLoadFinish;
- (void)showContainerView;

@end
